var path = require('path')
var htmlwebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
    devtool: false,
    entry: path.join(__dirname, './src/main.js'),
    output: {
        path: path.join(__dirname, './dist'),
        filename: 'bundle.js'
    },
    plugins: [
        new htmlwebpackPlugin({
            template: path.join(__dirname, './src/index.html'),
            filename: 'index.html'
        }),
        new VueLoaderPlugin()
    ],
    module: {
        rules: [
            { test: /\.css$/, use: ['style-loader', 'css-loader'] },
            { test: /\.(jpg|png|jpeg|bmp|gif)$/, use: 'url-loader' },
            { test: /\.(woff|ttf|woff2|eot|svg)$/, use: 'url-loader' },
            { test: /\.vue$/, use: 'vue-loader' },
            {
                test: /\.js$/,
                exclude: /node_modules|bower_components/,
                use: {
                    loader: "babel-loader"
                }
            }
        ]
    },
    watchOptions: {
        aggregateTimeout: 300,
        poll: 1000
    }

}